<%@page import="com.wodwl.entity.Blog"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.List"%>
<%@page import="com.wodwl.entity.User"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<%@include file="../templete/header.jsp" %>
	<script type="text/javascript">
	$(document).ready(function() {   
				$.ajax({       
					type: "POST",   
					url: "/blog/blog_list.do", 
					contentType: "application/json; charset=utf-8", 
					dataType: "json",       
					data: "{}",  
					success: function(res) { }   
					});
			}
		);
	</script>
</head>
<body >
<%pageContext.setAttribute("linkType","2");%>
<%@include file="../templete/user_info.jsp"  %>
	<% 
	List<Blog> blogs=(List<Blog>) request.getAttribute("blogs");
	//List<Blog> blogs=new ArrayList<Blog>();

%>
		

		
		<div class="conR">
			<div class="conR-hd">
				<h3>博客列表 
					<%for(int i=0;i<40;i++){ %>
					&nbsp;
					<%} %>
				 	<a href="/blog/blog_add_view.do?username=<%=user.getUsername()%>"><font color="green">撰写博客</font></a>|
				 	<a href="/blog/category_list.do"><font color="green">管理博客分类</font></a>
				 </h3>
				
			</div>


			<div class="oauth-sum-list">
				<div class="oauth-sum-listinfo">
					<table>
						<tbody>
			<%
				if(blogs!=null)
					for (int i = 0; i < blogs.size(); i++) {
						Blog item = blogs.get(i);
			%>

							<tr>
								<td colspan="4">
									<h3 >
										<em><a class="cBlue fB" href="/blog/blog_show.do?username=<%=user.getUsername()%>&bid=<%=item.getBid()%>"><%=item.getTitle() %></a></em>
									</h3>
									<p><b>作者：<a href="/user/info_display.do?username=<%=user.getUsername()%>&request_username=<%=item.getUsername()%>"><font color="blue"><%=item.getUsername()%></font></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<%=sdf.format(item.getCreate_time()) %></b></p>
									<p><%=item.getContent() %></p>
								</td>
								<td  >
									<a href="/blog/blog_show.do?username=<%=user.getUsername()%>&bid=<%=item.getBid()%>"><font color="green">查看详细</font></a>
								</td>
							</tr>
	
			<%
				}
			%>
							

						</tbody>
					</table>
				</div>

				<p class="pager-wrap pageList">
					<span class="pageList-cur">1</span> <a href="#" class="link-lb">2</a>
					<a href="#" class="link-lb">3</a> <a class="link-lb" href="#">下一页</a>
				</p>
			</div>
		</div>
	</div>

<jsp:include page="../templete/footer.jsp"></jsp:include>

</body>
</html>